package com.jblv.frame.demo;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

/**
 * @author happyonion.yangtao
 * @version 1.0
 * @title kafkaListenerMsg
 * @projectName jblv-frame
 * @packageName com.jblv.user.service
 * @description
 * @date Create at 2020/4/17 11:57
 * @since jdk1.8
 */

@Component
public class kafkaListenerMsg {
    private Log log = LogFactory.getLog(kafkaListenerMsg.class);

    @KafkaListener(topics = "springboot-topic1")
    public void processMessage(String content) {
        // ...
        log.info("recieve msg:" + content);

        try {
            Thread.sleep(8000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

}
